Marine World Heritage Sites shapefiles
This brief notebook merges marine World Heritage Sites shapefiles from different sources to be used for querying OBIS
Load spatial data
First fetch the Marine World Heritage Sites shapefile from MarineRegions:
library(sf)
library(dplyr)
library(mapview)
library(sfheaders)
if (!file.exists("data/shape/worldheritagemarineprogramme.shp")) {
download.file("http://geo.vliz.be/geoserver/wfs?request=getfeature&service=wfs&version=1.0.0&typename=MarineRegions:worldheritagemarineprogramme&outputformat=SHAPE-ZIP", "data/shape.zip")
unzip("data/shape.zip", exdir = "shape")
}
shapes_mr <- st_read("data/shape/worldheritagemarineprogramme.shp") %>%
select(full_name, country, geometry) %>%
mutate(full_name = iconv(full_name, "latin1", "UTF-8")) %>%
mutate(geometry = st_make_valid(sf_remove_holes(geometry))) %>%
group_by(full_name) %>%
summarize(geometry = st_union(geometry)) %>%
mutate(source = "MarineRegions")## Reading layer `worldheritagemarineprogramme' from data source
## `/Users/pieter/Dropbox (IPOfI)/werk/projects/MWHS/notebook-mwhs/data/shape/worldheritagemarineprogramme.shp'
## using driver `ESRI Shapefile'
## Simple feature collection with 129 features and 15 fields
## Geometry type: MULTIPOLYGON
## Dimension: XY
## Bounding box: xmin: -180 ymin: -55.00039 xmax: 180 ymax: 71.80583
## Geodetic CRS: WGS 84
Then load the shapefile provided by WHC.
shapes_whc <- st_read("data/World_Heritage_Sites/World_Heritage_Sites.shp", options = "ENCODING=UTF-8") %>%
filter(MARINE != "0") %>%
select(full_name = NAME, country = ISO3, geometry) %>%
mutate(geometry = st_make_valid(sf_remove_holes(geometry))) %>%
group_by(full_name) %>%
summarize(geometry = st_union(geometry)) %>%
mutate(source = "WHC (marine)")## options: ENCODING=UTF-8
## Reading layer `World_Heritage_Sites' from data source
## `/Users/pieter/Dropbox (IPOfI)/werk/projects/MWHS/notebook-mwhs/data/World_Heritage_Sites/World_Heritage_Sites.shp'
## using driver `ESRI Shapefile'
## Simple feature collection with 250 features and 32 fields
## Geometry type: MULTIPOLYGON
## Dimension: XY
## Bounding box: xmin: -180 ymin: -55.32282 xmax: 180 ymax: 71.81381
## Geodetic CRS: WGS 84
shapes_whc_notmarine <- st_read("data/World_Heritage_Sites/World_Heritage_Sites.shp", options = "ENCODING=UTF-8") %>%
filter(MARINE == "0") %>%
select(full_name = NAME, country = ISO3, geometry) %>%
mutate(geometry = st_make_valid(sf_remove_holes(geometry))) %>%
group_by(full_name) %>%
summarize(geometry = st_union(geometry)) %>%
mutate(source = "WHC (not marine)")## options: ENCODING=UTF-8
## Reading layer `World_Heritage_Sites' from data source
## `/Users/pieter/Dropbox (IPOfI)/werk/projects/MWHS/notebook-mwhs/data/World_Heritage_Sites/World_Heritage_Sites.shp'
## using driver `ESRI Shapefile'
## Simple feature collection with 250 features and 32 fields
## Geometry type: MULTIPOLYGON
## Dimension: XY
## Bounding box: xmin: -180 ymin: -55.32282 xmax: 180 ymax: 71.81381
## Geodetic CRS: WGS 84
Make a map:
mapviewOptions(legend.opacity = 0.5, fgb = FALSE)
mapview(bind_rows(shapes_mr, shapes_whc, shapes_whc_notmarine), zcol = "source", col.regions = c("#d95243", "#81b533", "#43b8d9"), lwd = 0.5, alpha = 1, alpha.regions = 0.5, layer.name = "Source")@map